<template>
  <div>
    <PoolCardSkeleton v-if="loading" />
    <div class="pool-card" v-else>
      <div class="item">
        <div class="earn">
          <span>Earn USDT</span>
          <span>Earn USDT stake DAI</span>
        </div>
        <div class="icon">
          <img src="@/assets/token/icon-usdt.svg" />
          <img src="@/assets/token/icon-dai.svg" />
        </div>
      </div>
      <div class="item">
        <span class="name">APR:</span>
        <div class="value">
          <span>41.21%</span>
        </div>
      </div>
      <div class="item">
        <div class="earned">
          <span>USDT EARNED</span>
          <span>1203.21</span>
        </div>
        <div class="g-clickable g-card-button-gradient button">
          <span>Harvest</span>
        </div>
      </div>
      <div class="item">
        <span class="name"> STAKED USDT </span>
      </div>
      <div class="g-clickable full-button">
        <span>Enabled</span>
      </div>
      <div class="info">
        <div class="top">
          <div class="g-clickable manual">
            <i class="iconfont icon-refresh"></i>
            <span>Manual</span>
          </div>
          <i class="iconfont icon-help"></i>
          <div class="fold">
            <span>Hide</span>
            <i class="iconfont icon-arrow-up"></i>
          </div>
        </div>
        <div class="sub">
          <span class="name">Stake</span>
          <div class="value">
            <span>DAI-USDT</span>
            <i class="iconfont icon-help"></i>
          </div>
        </div>
        <div class="sub">
          <span class="name">Total Liquidity</span>
          <div class="tip">
            <div class="value">
              <span>389,986</span>
              <i class="iconfont icon-time"></i>
            </div>
            <a href="#">
              <span>View Contract</span>
              <i class="iconfont icon-share"></i>
            </a>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import PoolCardSkeleton from "./PoolCardSkeleton";

export default {
  components: {
    PoolCardSkeleton,
  },
  props: {
    loading: {
      type: Boolean,
      default: false,
    },
  },
};
</script>

<style lang="scss" scoped>
.pool-card {
  background-color: var(--card);
  padding: 30px;
  border-radius: 30px;
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;

  .earn {
    display: flex;
    flex-direction: column;

    span {
      &:first-child {
        font-size: 18px;
        font-family: "Roboto Bold";
        color: var(--color);
        margin-bottom: 15px;
      }
      &:last-child {
        font-size: 14px;
        font-family: "Roboto Regular";
        color: var(--color-content);
      }
    }
  }

  .icon {
    position: relative;
    margin-right: 10px;
    img {
      border: 2px solid var(--border-color);
      border-radius: 50%;
      box-sizing: border-box;

      &:first-child {
        width: 70px;
        height: 70px;
      }

      &:last-child {
        width: 30px;
        height: 30px;
        position: absolute;
        right: -10px;
        bottom: 0;
        z-index: 1;
      }
    }
  }

  .name {
    font-size: 14px;
    font-family: "Roboto Regular";
    color: var(--color-content);
  }
  .value {
    font-size: 14px;
    font-family: "Roboto Bold";
    color: var(--color);

    i {
      font-size: 24px;
      margin-left: 5px;
    }
  }
  .earned {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    span {
      &:first-child {
        font-size: 14px;
        font-family: "Roboto Medium";
        color: var(--color-content);
        margin-bottom: 20px;
      }
      &:last-child {
        font-size: 18px;
        font-family: "Roboto Black";
        color: var(--color);
      }
    }
  }
  .button {
    width: 150px;
    height: 60px;
    border-radius: 30px;

    span {
      font-size: 15px;
      font-family: "Roboto Bold";
      color: var(--color);
    }
  }
}

.full-button {
  height: 60px;
  font-size: 18px;
  color: var(--color-dark);
  background-image: var(--button-bg);
  transition: all 0.3s ease;
  border-radius: 30px;
  margin-top: -10px;

  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;

  span {
    font-size: 15px;
    font-family: "Roboto Bold";
    color: var(--color-dark);
  }
}

.info {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin: 35px -30px 0;
  padding: 20px 30px 0;

  .top {
    display: grid;
    align-items: center;
    justify-content: space-between;
    grid-template-columns: 125px 50px 1fr;
  }

  .manual {
    width: 125px;
    height: 35px;
    border: 1px solid var(--color);
    border-radius: 35px;

    display: flex;
    align-items: center;
    justify-content: center;

    span {
      font-size: 16px;
      font-family: "Roboto Bold";
      color: var(--color);
    }

    i {
      font-size: 24px;
      margin-right: 10px;
    }
  }

  .icon-help {
    font-size: 24px;
    color: var(--color-content);
    margin-left: 10px;
  }

  .fold {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-end;

    span {
      font-size: 15px;
      font-family: "Roboto Bold";
      color: var(--color);
    }

    i {
      font-size: 20px;
      margin-left: 15px;
    }
  }

  .sub {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-top: 10px;

    .name {
      font-size: 14px;
      font-family: "Roboto Regular";
      color: var(--color-content);
      margin-bottom: 18px;
    }

    .tip {
      display: flex;
      flex-direction: column;
      align-items: flex-end;

      .value {
        margin-bottom: 5px;
      }
    }

    .value {
      display: flex;
      align-items: center;
      justify-content: flex-end;

      span {
        font-size: 14px;
        font-family: "Roboto Bold";
        color: var(--color);
      }
    }

    .num {
      font-size: 14px;
      font-family: "Roboto Bold";
      color: var(--color);
      margin-bottom: 5px;
    }

    a {
      font-size: 14px;
      font-family: "Roboto Medium";
      color: var(--color-sky-blue);
      text-decoration: none;
      display: flex;
      align-items: center;
      justify-content: flex-end;

      i {
        color: var(--color-sky-blue);
      }
    }

    i {
      font-size: 20px;
      color: var(--color-content);
    }
  }
}
</style>
